/*
 * Copyright Groupe Adeo 2009
 * 
 * Licensed under New BSD License : http://www.opensource.org/licenses/bsd-license.php
 */
package com.adeoservices.gwt.dispatch.spring.server.handler;

import java.util.List;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.DefaultActionHandlerRegistry;
import net.customware.gwt.dispatch.shared.Action;
import net.customware.gwt.dispatch.shared.Result;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 
 * @author Olivier HEDIN / Adeo Services
 *
 */
@Component
public class SpringActionHandlerRegistry extends DefaultActionHandlerRegistry {
	
	@Autowired
	public <A extends Action<R>, R extends Result> SpringActionHandlerRegistry(List<ActionHandler<A, R>> handlers)
	{
		for (ActionHandler<A, R> actionHandler : handlers) {
			addHandler(actionHandler);
		}
	}

}
